Other Functions
The following functions are available globally.
-
[Internal] Fails flow with given message
Declaration
Swift
public func Failure(_ message: String) -> Swift.NeverParameters
messageFailure message
Return Value
Never
-
Allows to verify if error was thrown, and if it is of given type.
Declaration
Swift
public func XCTAssertThrowsError<T, E: Error>(_ expression: @autoclosure () throws -> T, of error: E.Type, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line)Parameters
expressionExpression
errorExpected error type
messageOptional message
fileFile (optional)
lineLine (optional)
-
Allows to verify if error was throws, and if its exactly the one expected.
Declaration
Swift
public func XCTAssertThrowsError<T, E>(_ expression: @autoclosure () throws -> T, error: E, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) where E: Error, E: EquatableParameters
expressionExpression
errorExpected error conforming to Equatable, Error
messageOptional message
fileFile (optional)
lineLine (optional)
View on GitHub
Other Functions Reference